<div id="activationBill">
    <!--页面调整-->
    <el-row v-loading="showLoading"
            element-loading-text="拼命加载中">
        <el-col :span="24">
            <div class="inner btn-nav">
                <el-input
                        v-model="ckrwNo"
                        class="input"
                        icon="search"
                        placeholder="任务号"></el-input>
                <el-date-picker
                        v-model="date"
                        type="daterange"
                        align="right"
                        placeholder="制作日期"
                        class="datePicker"
                        :picker-options="pickerOptions">
                </el-date-picker>
                <el-date-picker
                        v-model="date2"
                        type="daterange"
                        align="right"
                        placeholder="预计到车"
                        class="datePicker"
                        :picker-options="pickerOptions">
                </el-date-picker>
                <el-input
                        class="input"
                        v-model="ckrwCph"
                        icon="search"
                        placeholder="车牌号"></el-input>
                <button @click="multiSelectClick" class="btn btn-multiSelect"><i
                        class="icon sel"></i><span>多选</span>
                </button>
                <button @click="multiOperationActivateTask" class="btn btn-Issued" v-show="multiSelect"><i
                        class="icon issued1"></i><span>激活任务</span>
                </button>
            </div>
            <el-table
                    :data="activationBill"
                    :default-sort="{prop: 'sjsj', order: 'descending'}"
                    :max-height="config_table_height()"
                    ref="table"
                    class="activationBillTable"
                    @expand="expandChange"
                    @selection-change="multiSelectionChange"
                    style="width: 100%">
                <el-table-column
                        type="expand">
                    <template scope="props">
                        <el-carousel
                                arrow="hover"
                                height="280px"
                                indicator-position="none"
                                :autoplay="false">
                            <el-carousel-item>
                                <el-row>

                                    <h3>激活单据详细<span
                                            style="font-size: 14px;
                                            font-weight: normal;
                                            margin-left: 5px;">(翻页查看任务单据）</span>
                                    </h3>
                                </el-row>
                                <el-form label-position="left" inline class="demo-table-expand">
                                    <el-row>
                                        <el-col :span="10">
                                            <el-form-item label="物流商">
                                                <span>{{ props.row.ckrwWls }}</span>
                                            </el-form-item>

                                            <el-form-item label="任务号">
                                                <el-tag type="success">{{props.row.ckrwNo}}</el-tag>
                                            </el-form-item>

                                            <el-form-item label="车牌号">
                                                <span>{{ props.row.ckrwCph }}</span>
                                            </el-form-item>
                                            <el-form-item label="订单数">
                                                <span>{{props.row.orderNum}}</span>
                                            </el-form-item>
                                            <el-form-item label="品项数">
                                                <span>{{props.row.goodsTypeNum}}</span>
                                            </el-form-item>
                                            <el-form-item label="任务状态">
                                                <el-tag-s
                                                        :val="auto_el_tag('ckRwStatus',props.row.ckrwStatus)"></el-tag-s>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="10" :offset="2">
                                            <el-form-item label="预计到车">
                                        <span>
                                             <el-icon name="time"></el-icon>
                                            {{ auto_time_new(props.row.ckrwYjdcsj,6) }}
                                        </span>
                                            </el-form-item>
                                            <el-form-item label="实际到车"
                                                          v-show="props.row.ckrwSjdcsj!=null"><span>
                                             <el-icon name="time"></el-icon>
                                            {{ auto_time_new(props.row.ckrwSjdcsj,6) }}
                                        </span>
                                            </el-form-item>
                                            <el-form-item label="欠货状态">
                                                <el-tag-s
                                                        :val="auto_el_tag('ckQhStatus',props.row.ckrwQhStatus)"></el-tag-s>
                                            </el-form-item>
                                            <el-form-item label="滞留状态">
                                                <el-tag-s
                                                        :val="auto_el_tag('ckZlStatus',props.row.ckrwZlStatus)"></el-tag-s>
                                            </el-form-item>
                                            <el-form-item
                                                    label="可用操作">
                                                <el-button
                                                        size="small"
                                                        type="success"
                                                        v-show="props.row.ckrwStatus==21"
                                                        @click="inlineActivateTask(props.$index, props.row)">激活任务
                                                </el-button>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-carousel-item>
                            <el-carousel-item>
                                <el-row>
                                    <h3>出库任务单据<span
                                            style="font-size: 14px;
                                            font-weight: normal;
                                            margin-left: 5px;">（双击查看明细）</span>
                                    </h3>
                                </el-row>
                                <el-table
                                        :data="props.row.mfunckDoc"
                                        @row-dblclick="dblClick"
                                        :max-height="240">
                                    <el-table-column
                                            label="出库单号"
                                            width="170"
                                            show-overflow-tooltip
                                            align="center"
                                            prop="ckCkdjNo">
                                    </el-table-column>
                                    <el-table-column
                                            width="100"
                                            align="center"
                                            label="下单时间">
                                        <template scope="scope">
                                            <span>{{ auto_time_new(scope.row.ckXdsj,2) }}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="客户名"
                                            align="center"
                                            show-overflow-tooltip>
                                        <template scope="scope">
                                            {{scope.row.ckCkdjClientname}}
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            label="联系人"
                                            align="center"
                                            show-overflow-tooltip
                                            prop="ckContacts">
                                    </el-table-column>
                                    <el-table-column
                                            label="电话"
                                            align="center"
                                            show-overflow-tooltip
                                            prop="ckTel">
                                    </el-table-column>
                                    <el-table-column
                                            label="地址"
                                            align="center"
                                            show-overflow-tooltip
                                            prop="ckAdress">
                                    </el-table-column>
                                    <el-table-column
                                            label="状态"
                                            align="center"
                                            show-overflow-tooltip>
                                        <template scope="scope">
                                            <el-tag-s :val="auto_el_tag('ckStatus',scope.row.ckStatus)"></el-tag-s>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                            width="120"
                                            align="center"
                                            label="可用操作">
                                        <template scope="scope">
                                            <!--v-if="props.row.ckrwStatus>10&&props.row.ckrwStatus<42"-->
                                          <el-row v-if="scope.row.ckGqStatus==1">
                                            <el-button
                                                    size="mini"
                                                    type="success"
                                                    v-if="scope.row.ckQhStatus==1&&scope.row.ckCkdjType==0"
                                                    @click="inlineActivateDocument(scope.$index, scope.row)">激活
                                            </el-button>
                                            <el-button
                                                    size="mini"
                                                    type="info"
                                                    v-if="scope.row.ckStatus==21||(scope.row.ckStatus==22&&scope.row.ckStartwith==2)"
                                                    @click="inlineSupplementaryDistribution(scope.$index, scope.row)">
                                                追加分拣
                                            </el-button>
                                          </el-row>
                                          <el-row>
                                            <el-button
                                                size="mini"
                                                type="warning"
                                                v-if="scope.row.ckGqStatus==2"
                                                @click="inlinePendingConfirmation(scope.$index, scope.row)">挂起确认
                                            </el-button>
                                            <el-tag
                                                type="success"
                                                v-if="scope.row.ckGqStatus==3">
                                              已确认
                                            </el-tag>
                                          </el-row>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </el-carousel-item>
                        </el-carousel>
                    </template>
                </el-table-column>
                <el-table-column
                        label="物流商"
                        show-overflow-tooltip
                        prop="ckrwWls"
                        align="center">
                </el-table-column>
                <el-table-column
                        label="任务号"
                        show-overflow-tooltip
                        prop="ckrwNo"
                        align="center">
                </el-table-column>
                <el-table-column
                        label="车牌号"
                        show-overflow-tooltip
                        align="center"
                        prop="ckrwCph">
                </el-table-column>
                <el-table-column
                        label="预计到车"
                        show-overflow-tooltip
                        align="center">
                    <template scope="scope">
                        {{auto_time_new(scope.row.ckrwYjdcsj,4)}}
                    </template>
                </el-table-column>
                <el-table-column
                        label="实际到车"
                        show-overflow-tooltip
                        align="center">
                    <template scope="scope">
                        {{auto_time_new(scope.row.ckrwSjdcsj,4)}}
                    </template>
                </el-table-column>
                <el-table-column
                        label="订单数"
                        show-overflow-tooltip
                        align="center"
                        prop="orderNum">
                </el-table-column>
                <el-table-column
                        label="品项数"
                        show-overflow-tooltip
                        align="center"
                        prop="goodsTypeNum">
                </el-table-column>
                <el-table-column
                        label="任务状态"
                        prop="status"
                        align="center">
                    <template scope="scope">
                        <el-tag-s :val="auto_el_tag('ckRwStatus',scope.row.ckrwStatus)"></el-tag-s>
                    </template>
                </el-table-column>
                <el-table-column
                        v-if="multiSelect"
                        type="selection"
                        width="60">
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[5, 10, 15, 20, 100, 500, 1000, 5000, 10000]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="currentTotal">
                </el-pagination>
            </div>
        </el-col>
    </el-row>
    <el-dialog
            size="large"
            v-model="dialogFormVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">{{form.title}}</span>
            <el-steps
                    class="steps"
                    :space="120"
                    :active="dialogFormActive"
                    finish-status="success">
            </el-steps>
        </div>
        <el-form :model="form" ref="newForm">
            <el-carousel
                    ref="carousel"
                    :autoplay="false"
                    arrow="never"
                    indicator-position="none"
                    height="55vh">
                <el-carousel-item>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item
                                    label="物流商"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwWls"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="任务号"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwNo"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="车牌号"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwCph"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="订单数"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.orderNum"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="品项数"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.goodsTypeNum"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10" :offset="2">
                            <el-form-item
                                    label="预计到车时间"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwYjdcsj"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="实际到车时间"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwSjdcsj"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="任务状态"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwStatus"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="欠货状态"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwQhStatus"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="滞留状态"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ckrwZlStatus"
                                        v-model.number="form.ckrwZlStatus"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-carousel-item>
            </el-carousel>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submit" :loading="submitLoading">保存
            </el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="large"
            custom-class="mxClass"
            v-model="dialogListsVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">出库明细 单号：{{lists.ckCkdjNo}}</span>
        </div>
        <el-table
                :data="lists.data"
                highlight-current-row
                style="width: 100%">
            <el-table-column
                    type="index"
                    width="55">
            </el-table-column>
            <el-table-column
                    label="货品编号"
                    show-overflow-tooltip
                    align="center"
                    prop="baseGoods.bgGoodsNo">
            </el-table-column>
            <el-table-column
                    label="货品名称"
                    show-overflow-tooltip
                    align="center"
                    prop="baseGoods.bgGoodsName">
            </el-table-column>
            <el-table-column
                    label="货品数量"
                    show-overflow-tooltip
                    align="center"
                    prop="cksGoodsCount">
            </el-table-column>
            <el-table-column
                    label="分拣方式"
                    show-overflow-tooltip
                    align="center">
                <template scope="scope">
                    {{auto_fjfs(scope.row.cksCkfs)}}
                </template>
            </el-table-column>
            <el-table-column
                    label="批次"
                    show-overflow-tooltip
                    align="center"
                    prop="cksZdpc">
            </el-table-column>
            <el-table-column
                    label="库位"
                    show-overflow-tooltip
                    align="center"
                    prop="baseLocation.blLname">
            </el-table-column>
            <el-table-column
                    label="操作"
                    prop="rksCount"
                    align="center">
                <template scope="scope">
                    <el-button
                            size="small"
                            type="info"
                            icon="edit"
                            @click="inlineModifySorting(scope.$index, scope.row)">
                    </el-button>
                </template>
            </el-table-column>
        </el-table>


        <el-dialog
                :modal="false"
                size="small"
                v-model="lists.dialogLocationVisible">
            <div class="dialog-title clearfix" slot="title">
                <span class="el-dialog__title">修改分拣方式</span>
            </div>
            <el-form>
                <el-form-item label="分拣方式" :label-width="formLabelWidth">
                    <el-select v-model="lists.sort.cksCkfs" placeholder="请选择">
                        <el-option value="X" label="先进先出"></el-option>
                        <el-option value="K" label="指定储位"></el-option>
                        <el-option value="P" label="指定批次"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="库位" :label-width="formLabelWidth" v-show="lists.sort.cksCkfs=='K'">
                    <el-autocomplete
                            :fetch-suggestions="queryLocationAsync"
                            v-model="lists.sort.baseLocation.blLname"
                            @select="locationSelect"
                            auto-complete="off"></el-autocomplete>
                </el-form-item>
                <el-form-item label="批次" :label-width="formLabelWidth" v-show="lists.sort.cksCkfs=='P'">
                    <el-input
                            v-model="lists.sort.cksZdpc"
                            auto-complete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="locationSubmit" :loading="lists.locationLoading">修改</el-button>
            </div>
        </el-dialog>


        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="dialogListsVisible=false">关闭</el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="large"
            custom-class="mxClass"
            v-model="dialogLists2Visible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">分拣明细 单号：{{lists2.ckCkdjNo}}</span>
        </div>
        <el-table
                :data="lists2.data"
                highlight-current-row
                style="width: 100%">
            <el-table-column
                    type="index"
                    width="75">
            </el-table-column>
            <el-table-column
                    label="货品编号"
                    width="130"
                    show-overflow-tooltip
                    align="center"
                    prop="mfunRepertory.baseGoods.bgGoodsNo">
            </el-table-column>
            <el-table-column
                    label="货品名称"
                    show-overflow-tooltip
                    align="center"
                    prop="mfunRepertory.baseGoods.bgGoodsName">
            </el-table-column>
            <el-table-column
                    label="库位"
                    width="120"
                    show-overflow-tooltip
                    align="center"
                    prop="mfunRepertory.baseLocation.blLname">
            </el-table-column>
            <el-table-column
                    label="换算量"
                    width="100"
                    show-overflow-tooltip
                    align="center"
                    prop="mfunRepertory.baseGoods.bgHsl">
            </el-table-column>
            <el-table-column
                    label="件数"
                    width="100"
                    show-overflow-tooltip
                    align="center"
                    prop="jianshu">
            </el-table-column>
            <el-table-column
                    label="分配量"
                    width="100"
                    prop="msxMxCount"
                    align="center">
            </el-table-column>
            <el-table-column
                    label="修改分配量"
                    width="130"
                    align="center">
                <template scope="scope">
                    <el-slider
                            :disabled="scope.row.max==0"
                            :max="scope.row.max"
                            v-model="scope.row.msxMxCount">
                    </el-slider>
                </template>
            </el-table-column>
        </el-table>
        <div slot="footer" class="dialog-footer">
            <el-button :loading="submitLoading" type="primary" @click="list2Submit">保存</el-button>
            <el-button @click="dialogLists2Visible=false">关闭</el-button>
        </div>
    </el-dialog>
</div>
<style>
    #activationBill {
        width: 100%;
        min-width: 890px;
        position: relative;
    }

    #activationBill .demo-table-expand {
        font-size: 0;
    }

    #activationBill .demo-table-expand label {
        width: 90px;
        color: #99a9bf;
    }

    #activationBill .demo-table-expand .el-form-item {
        margin-right: 0;
        margin-bottom: 0;
        width: 80%;
    }

    #activationBill .el-table__expand-column .el-table__expand-icon {
        height: 39px;
    }

    #activationBill .table {
        transition: 1s all;
    }

    #activationBill .el-carousel__container {
        height: 440px;
    }

    .el-tooltip__popper {
        max-width: 400px;
    }

    .el-step__main {
        max-width: calc(100% - 60px);
    }

    #activationBill .activationBillTable {
        width: 95% !important;
        margin: 20px auto;
    }

    #activationBill .datePicker {
        width: 140px !important;
        height: 24px !important;
        margin-top: 29px;
        margin-right: 18px;
        float: left;
    }

    #activationBill .datePicker .el-input__inner {
        border-radius: 2px !important;
        height: 24px !important;
    }

    #activationBill .add {
        background: url("/static/images/add.png") no-repeat center;
    }

    #activationBill .del {
        background: url("/static/images/del.png") no-repeat center;
    }

    #activationBill .search {
        background: url("/static/images/search.png") no-repeat center;
    }

    #activationBill .sel {
        background: url("/static/images/sel.png") no-repeat center;
    }

    #activationBill .icon {
        float: left;
    }

    #activationBill .btn span {
        float: left;
        margin-top: 4px;
        margin-left: 2px;
    }

    #activationBill .btn {
        height: 24px;
        line-height: 1;
        border: none;
        background: #f8fafb;
        outline: none;
        cursor: pointer;
        padding: 0;
        margin: 0;
        float: left;
        font-size: 14px;
        color: #1f2d3d;
        margin-top: 29px;
        margin-right: 16px;
    }

    #activationBill .btn-print {
        margin-right: 0;
    }

    #activationBill .btn:hover {
        color: #5468ee;
    }

    #activationBill .inner {
        margin: 0 20px;
    }

    #activationBill .btn-nav {
        height: 60px;
        overflow: hidden;
    }

    #activationBill .btn-nav .el-input .el-input__inner {
        height: 24px;
    }

    #activationBill .btn-nav .el-input {
        float: left;
        margin-top: 29px;
        margin-right: 18px;
        width: 140px;
        height: 24px;
    }
</style>
<style>
    .steps {
        position: absolute;
        bottom: 10px;
        left: 30px;
        margin: auto;
    }

    .el-dialog__headerbtn {
        position: absolute;
        right: 25px;
        top: 15px;
    }

    .el-step__main {
        margin-left: -8px !important;
    }
</style>
<style>
    .select {

    }

    .select .input {
        width: 70%;
    }
</style>
<script>
    var activationBill = new Vue({
        el: '#activationBill',
        prop: {},
        data: function () {
            return {
                activationBill: [],
                multipleSelection: [],
                multiSelect: false,
                pickerOptions: {
                    shortcuts: [{
                        text: '最近一周',
                        onClick: function (picker) {
                            var end = new Date();
                            var start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick: function (picker) {
                            var end = new Date();
                            var start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick: function (picker) {
                            var end = new Date();
                            var start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }]
                },
                showLoading: false,
                currentPage: 1,
                pageSize: 10,
                currentTotal: 0,
                date: [null, null],                 //主页面 制作日期 搜索
                date2: [null, null],                //主页面 预计到车 搜索
                ckrwNo: '',                         //主页面 任务号 搜索
                ckrwCph: '',                        //主页面 车牌号 搜索
                formLabelWidth: '120px',            //表单 配置
                form: form(),                       //表单 弹出层 信息集合
                dialogFormActive: 0,                //新建 弹出层 steps 当前进度
                dialogFormVisible: false,           //新建 弹出层 是否可见
                submitLoading: false,               //新建 弹出层 提交等待

                sortingMethod: [],                  //修改分拣方式信息  弹出层 信息集合
                dialogSortingMethodVisible: false,  //修改分拣方式信息  弹出层 是否可见


                dialogListsVisible: false,          //单据详细 查询
                dialogLists2Visible: false,          //单据详细 查询
                lists: formList(),                  //出库详细 弹出层 信息集合
                lists2: formList2(),                  //出库详细 弹出层 信息集合

                select: form(),                     //搜索 弹出层 信息集合,
                dialogSelectVisible: false,
                selectLoading: false
            }
        },
        computed: {
            option: function () {
                return {
                    "draw": 1,
                    "pageNum": this.currentPage,
                    "pageSize": this.pageSize,
                    "ckrwNo": this.ckrwNo,
                    "ckrwCph": this.ckrwCph,
                    "ckrwStartGreatTime": tsf_date(this.date[0]),
                    "ckrwEndGreatTime": tsf_date(this.date[1]),
                    "ckrwStartYjdcsj": tsf_date(this.date2[0]),
                    "ckrwEndYjdcsj": tsf_date(this.date2[1]),
                    ckArehouseId:window.dbmessage.baseArehouses[0].baArehouseId,
                }
            },
            search: function () {
                return {
                    "draw": 1,
                    "pageNum": this.currentPage,
                    "pageSize": this.pageSize,
                    "rkrwN": this.form.rkrwN,
                    "rkrwCph": this.form.rkrwCph,
                    "dds": this.form.dds,
                    "pxs": this.form.pxs,
                    "rkrwSjxm": this.form.rkrwSjxm,
                    "rkrwDhrq": this.form.rkrwDhrq,
                    "rkrwDbd": this.form.rkrwDbd,
                    "rkrwCys": this.form.rkrwCys,
                    "rkrwDh": this.form.rkrwDh,
                    "rkrwStatus": this.form.rkrwStatus
                }
            },
        },
        methods: {
            inlineActivateTask: function (index, row) {                           //行内按钮 激活任务
                obj.$confirm('此操作将此出库单激活任务, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(function () {
                    p[1].post({
                        "ids": [row.ckrwId],
                        "useId": app.rmsUser.ruUserId,
                        "userName": app.rmsUser.ruUserName
                    }, function (json) {
                        this.callbackAfter({status: json.status, model: '激活任务'}, function () {
                            p[0].post(obj.option);
                        })
                    });
                }).catch(function () {
                    _this.$message({
                        type: 'info',
                        message: '已取消激活任务'
                    });
                });
            },                         //行内按钮-激活任务
            inlineSupplementaryDistribution: function (index, row) {                           //TODO 行内按钮 追加分拣
                var _this = this;
                _this.$confirm('此操作将追加分拣出库单, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(function () {
                    p[3].post({
                        "id": row.ckCkdjId,
                        "useId": app.rmsUser.ruUserId,
                        "userName": app.rmsUser.ruUserName
                    }, function (json) {
                        this.callbackAfter({status: json.status, model: '追加分拣'}, function () {
                            p[0].post(obj.option);
                        })
                    });
                }).catch(function () {
                    _this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },            //行内按钮-追加分拣
            inlineModifySorting: function (index, row) {
              var step = formListSort();
              allPrposCb(step, function (obj2, index) {
                if (typeof row[index] !== 'undefined') step[index] = row[index];
              });
              step.index = index;
              if (step.baseLocation === null) {
                step.baseLocation = {
                  blLocationId: 0,
                  blLname: ''
                }
              }

              if (step.cksZdpc == null || step.cksZdpc === '' || step.cksZdpc === '无') {
                step.cksZdpc = auto_time_new(new Date(), 3);
              }

              this.lists.sort = step;
              this.lists.dialogLocationVisible = true;
            },                        //行内按钮-修改分拣方式
            inlinePendingConfirmation: function (index, row) {
                var _this = this;
                _this.$confirm('此操作将出库单挂起确认, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(function () {

                    p[4].post({
                        "id": row.ckCkdjId,
                        "useId": app.rmsUser.ruUserId,
                        "userName": app.rmsUser.ruUserName
                    }, function (json) {
                        this.callbackAfter({status: json.status, model: '单挂起确认'}, function () {
                            row.ckGqStatus = 3;
                        })
                    });
                }).catch(function () {
                    _this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },                  //行内按钮-挂起确认
            inlineActivateDocument: function (index, row) {
                var _this = this;
                _this.$confirm('此操作将激活出库单据, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(function () {
                    p[5].post({
                        "id": row.ckCkdjId,
                        "useId": app.rmsUser.ruUserId,
                        "userName": app.rmsUser.ruUserName
                    }, function (json) {
                        if (json.status !== 50016) {
                            json.model = '激活出库单据';
                        }
                        this.callbackAfter(json, function () {
                            p[0].post(obj.option);
                        })
                    });
                }).catch(function () {
                    _this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },                     //行内按钮-激活单据
            multiSelectClick: function () {
                this.multiSelect = !this.multiSelect;
            },                                     //多选 状态维护
            multiSelectionChange: function (val) {
                /*<debug>*/
                console.log(this.multipleSelection);
                /*</debug>*/
                this.multipleSelection = val;
            },                              //多选 选中控制
            multiOperationActivateTask: function () {
                var _this = this;
                _this.$confirm('此操作将此出库单激活任务, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(function () {
                    var ids = [];
                    for (var i = 0; i < obj.multipleSelection.length; i++) {
                        ids.push(obj.multipleSelection[i].ckrwId);
                    }
                    p[1].post({
                        "ids": ids,
                        "useId": app.rmsUser.ruUserId,
                        "userName": app.rmsUser.ruUserName
                    }, function (json) {
                        this.callbackAfter({status: json.status, model: '激活任务'}, function () {
                            p[0].post(obj.option);
                        })
                    });
                }).catch(function () {
                    _this.$message({
                        type: 'info',
                        message: '已取消激活任务'
                    });
                });

            },                           //多选 激活任务
            handleSizeChange: function (val) {
                /*<debug>*/
                console.log('每页' + val + '条');
                /*</debug>*/
                this.pageSize = val;
                p[0].post(this.option);
            },                                  //分页 Size
            handleCurrentChange: function (val) {
                /*<debug>*/
                console.log('当前第' + val + '页');
                /*</debug>*/
                this.currentPage = val;
                p[0].post(this.option);
            },                               //分页 当前页


            queryLocationAsync: function (queryString, cb) {
                p[103].post({
                    "pageNum": 1,
                    "pageSize": 10,
                    "draw": 0,
                    blLName: queryString,
                    arehouseId: window.dbmessage.baseArehouses[0].baArehouseId
                }, function (json) {
                    json = json.data;
                    var step = [];
                    var length = json.length > 20 ? 20 : json.length;
                    for (var i = 0; i < length; i++) {
                        step.push({data: json[i], value: json[i].blLname})
                    }
                    cb(step);
                });
            },
            locationSelect: function (item) {
                this.lists.sort.cksLocationId = item.data.blLocationId;
                this.lists.sort.baseLocation = item.data;
            },
            locationSubmit: function () {
                obj.lists.locationLoading = true;
                p[102].post({
                    cksCkmxId: obj.lists.sort.cksCkmxId,
                    cksCkfs: obj.lists.sort.cksCkfs,
                    cksLocationId: obj.lists.sort.cksLocationId,
                    cksZdpc: obj.lists.sort.cksZdpc
                }, function (json) {
                    obj.lists.locationLoading = false;
                    this.callbackAfter({status: json.status, model: '修改分拣方式'}, function () {
                        switch (obj.lists.sort.cksCkfs) {
                            case 'X':
                                obj.lists.data[obj.lists.sort.index].cksCkfs = '先进先出';
                                obj.lists.data[obj.lists.sort.index].baseLocation = {
                                    blLocationId: 1,
                                    blLname: ''
                                };
                                obj.lists.data[obj.lists.sort.index].cksZdpc = '';
                                break;
                            case 'K':
                                obj.lists.data[obj.lists.sort.index].cksCkfs = '指定储位';
                                obj.lists.data[obj.lists.sort.index].baseLocation = obj.lists.sort.baseLocation;
                                obj.lists.data[obj.lists.sort.index].cksZdpc = '';
                                break;
                            case 'P':
                                obj.lists.data[obj.lists.sort.index].cksCkfs = '指定批次';
                                obj.lists.data[obj.lists.sort.index].baseLocation = {
                                    blLocationId: 1,
                                    blLname: ''
                                };
                                obj.lists.data[obj.lists.sort.index].cksZdpc = obj.lists.sort.cksZdpc;
                                break;
                        }
                        obj.lists.dialogLocationVisible = false;
                    })
                })
            },
            expandChange: function (row, expanded) {
                if (expanded && (typeof (row.mfunckDoc) === 'undefined' || row.mfunckDoc === null || row.mfunckDoc.length === 0)) {
                    p[104].post({
                        id: row.ckrwId,
                        arehouseId: window.dbmessage.baseArehouses[0].baArehouseId
                    }, function (json) {
                        /*<debug>*/
                        console.log(json);
                        /*</debug>*/
                        row.mfunckDoc = json.model;
                    });
                }
                /*<debug>*/
                console.log(row);
                console.log(expanded);
                /*</debug>*/
            },                             //下拉 选择
            dblClick: function (row, event) {
                if ((row.ckStatus === 21 || row.ckStatus === 31) && row.ckGqStatus !== 2) {
                    obj.$confirm('请选择 您想查询的页面', '提示', {
                        confirmButtonText: '单据明细',
                        cancelButtonText: '分拣明细',
                        type: 'warning'
                    }).then(function () {
                        if (typeof row.mfunckDocs === 'undefined' || row.mfunckDocs === null || row.mfunckDocs.length < 1) {
                            p[101].post({id: row.ckCkdjId}, function (json) {
                                row.mfunckDocs = json.model;
                                obj.lists.data = row.mfunckDocs;
                                obj.lists.ckCkdjNo = row.ckCkdjNo;
                                obj.dialogListsVisible = true;
                            })
                        } else {
                            obj.lists.data = row.mfunckDocs;
                            obj.lists.ckCkdjNo = row.ckCkdjNo;
                            obj.dialogListsVisible = true;
                        }
                    }).catch(function () {
                        p[7].post({id: row.ckCkdjId}, function (json) {
                            for (var i = 0; i < json.model.length; i++) {
                                json.model[i].max = json.model[i].msxMxCount;
                            }
                            row.fjsl = json.model;
                            obj.lists2.data = row.fjsl;
                            obj.lists2.ckCkdjNo = row.ckCkdjNo;
                            obj.dialogLists2Visible = true;
                        })
                    });
                } else {
                    if (typeof row.mfunckDocs === 'undefined' || row.mfunckDocs === null || row.mfunckDocs.length < 1) {
                        p[101].post({id: row.ckCkdjId}, function (json) {
                            row.mfunckDocs = json.model;
                            obj.lists.data = row.mfunckDocs;
                            obj.lists.ckCkdjNo = row.ckCkdjNo;
                            obj.dialogListsVisible = true;
                        })
                    } else {
                        obj.lists.data = row.mfunckDocs;
                        obj.lists.ckCkdjNo = row.ckCkdjNo;
                        obj.dialogListsVisible = true;
                    }
                }

            },

            newInput: function () {
                this.dialogFormVisible = true;

            },                                             //按钮 新建入库单
            prev: function () {
                this.dialogFormActive--;
                this.$refs.carousel.prev();
            },                                                 //新建 弹出层banner控制 前一个
            next: function () {
                this.dialogFormActive++;
                this.$refs.carousel.next();
            },                                                 //新建 弹出层banner控制 后一个
            submit: function () {
                var _this = this;
                this.dialogFormActive++;
                this.submitLoading = true;
                //TODO 此处应是ajax请求
                setTimeout(function () {
                    _this.submitLoading = false;
                    _this.$notify({
                        title: '成功',
                        message: '保存成功！',
                        type: 'success'
                    });
                    _this.dialogFormVisible = false;
                    _this.form = {
                        rkRkdjNo: '',
                        rkType: '',
                        rkRemarks: '',
                        rkDocsList: [],
                        bgGoodsNo: '',
                        selectGood: {
                            value: '',
                            bgGoodsName: '',
                            count: 0,
                            bgGoodsId: ''
                        },
                        saveARkDocsList: true,
                        deleteARkDocsList: true
                    };
                    _this.dialogFormActive = 0;
                    _this.$refs.carousel.setActiveItem(0);
                    p[0].post();
                }, 1500);
            },                                               //新建 表单提交
            list2Submit: function () {
                obj.submitLoading = true;
                var list = [];
                var step = {};
                for (var i = 0; i < obj.lists2.data.length; i++) {
                    if (obj.lists2.data[i].max === obj.lists2.data[i].msxMxCount)continue;
                    step = _sortingMxList();
                    allPrposCb(step, function (obj2, index) {
                        if (typeof obj.lists2.data[i][index] !== 'undefined') step[index] = obj.lists2.data[i][index];
                    });
                    list.push(step);
                }
                var option = {
                    "useId": app.rmsUser.ruUserId,
                    "sortingMxList": list
                };

                p[6].post(option, function (json) {
                    obj.submitLoading = false;
                    this.callbackAfter(json, function () {
                        obj.lists2 = formList2();
                        obj.dialogLists2Visible = false;
                    })
                })

            },                                          //新建 表单提交
            selectSubmit: function () {
                this.dialogSelectVisible = !this.dialogSelectVisible;
                p[0].post({});
            },                                         //详细查询 提交

            auto_ckrwStatus: function (value) {
                var temp = {};
                if (!isNaN(value)) {
                    temp = {
                        10: '初始',
                        11: '已下发',
                        21: '已挑选',
                        31: '已激活',
                        41: '部分出库',
                        42: '全部出库',
                        51: '部分发运',
                        52: '全部发运'
                    }
                } else {
                    temp = {
                        '初始': 10,
                        '已下发': 11,
                        '已挑选': 21,
                        '已激活': 31,
                        '部分出库': 41,
                        '全部出库': 42,
                        '部分发运': 51,
                        '全部发运': 52
                    }
                }
                return temp[value];
            },                                 //任务状态
            auto_ckrwQhStatus: function (value) {
                var temp = {};
                if (!isNaN(value)) {
                    temp = {
                        1: '欠货',
                        2: '未欠货'
                    }
                } else {
                    temp = {
                        '欠货': 1,
                        '未欠货': 2

                    }
                }
                return temp[value];
            },                               //欠货状态
            auto_ckrwZlStatus: function (value) {
                var temp = {};
                if (!isNaN(value)) {
                    temp = {
                        1: '滞留',
                        2: '未滞留'
                    }
                } else {
                    temp = {
                        '滞留': 1,
                        '未滞留': 2

                    }
                }
                return temp[value];
            },                               //滞留状态
            auto_ckStatus: function (value) {
                var temp = {};
                if (!isNaN(value)) {
                    temp = {
                        1: '原始状态',
                        21: '部分分拣',
                        22: '部分下架',
                        31: '全部分拣',
                        32: '全部下架',
                        50: '作废',


                    }
                } else {
                    temp = {
                        '原始状态': 1,
                        '部分分拣': 21,
                        '部分下架': 22,
                        '全部分拣': 31,
                        '全部下架': 32,
                        '作废': 50


                    }
                }
                return temp[value];
            },                                   //单据状态

            auto_fjfs: function (value) {
                switch (value) {
                    case 'k':
                    case 'K':
                        return '指定储位';
                    case 'p':
                    case 'P':
                        return '指定批次';
                    case 'x':
                    case 'X':
                        return '先进先出';
                }
            }

        },
        watch: {
            ckrwNo: function () {
                /*<debug>*/
                console.log(this.option);
                /*</debug>*/
                p[0].post(this.option);
            },
            ckrwCph: function () {
                /*<debug>*/
                console.log(this.option);
                /*</debug>*/
                p[0].post(this.option);
            },
        }
    });
    // 高级 监视器的 使用方法
    activationBill.$watch('date', function () {

        /*<debug>*/
        console.log(this.option);
        /*</debug>*/
        p[0].post(this.option);
    }, {deep: true});
    activationBill.$watch('date2', function () {
        /*<debug>*/
        console.log(this.option);
        /*</debug>*/
        p[0].post(this.option);
    }, {deep: true});

    function formList() {
        return {
          data: [],

          ckRwStatus: 0,
          ckCkdjType: 0,
          ckStatus: 0,

          ckCkdjNo: '',
          dialogLocationVisible: false,
          locationLoading: false,

          sort: formListSort()
        }
    }
    function formList2() {
        return {
            data: [],
            ckCkdjNo: ''
        }
    }
    function formListSort() {
        return {
            cksCkmxId: 1,
            cksCkfs: "X",  // X K P

            cksLocationId: 1,

            baseLocation: {
                blLocationId: 1,
                blLname: ''
            },

            cksZdpc: auto_time_new(new Date(), 3),

            index: 0
        }
    }
    function _sortingMxList() {
        return {
            "msxMxId": 0,
            "msxMxCount": 0,
            "msxWt": 3
        }
    }
    function form() {
        return {
            ckrwId: '',
            title: "新建出库任务",
            ckrwN: '',
            dds: '',
            pxs: '',
            ckrwSjxm: '',
            ckrwDhrq: '',
            ckrwDbd: '',
            ckrwCys: '',
            ckrwDh: '',
            ckrwStatus: '',
            ckrwCph: '',                    //模糊查询--车牌号
            ckrwNo: '',                     //模糊查询 --任务号
            ckrwHistoryCzsj: [null, null],//模糊查询--制作时间
            ckrwYjdcsj: [null, null],     //模糊查询--预计到车时间
        }
    }
    var obj = activationBill;
    var p = [];

    // 0 激活单据 分页查询
    p[0] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/0",
        success: function (json) {
            for (var i = 0; i < json.data.length; i++) {
                json.data[i].mfunckDoc = [];
            }
            obj.$data.activationBill = json.data;
            obj.$data.currentTotal = json.recordsFiltered;
        }
    });
    // 1 激活单据-激活任务
    p[1] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/1",
        method: 'GET'
    });
    // 2 激活单据-修改-分拣方式
    p[2] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/2"
    });
    // 3 激活单据-追加分拣
    p[3] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/3"
    });
    // 4 激活单据-挂起确认
    p[4] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/4"
    });
    // 5 激活单据-激活单据
    p[5] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/5"
    });
    // 6 激活单据-修改-分拣明细数量
    p[6] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/6",
        method: 'GET'
    });
    // 7 激活单据-查询-分拣明细
    p[7] = autoPost({
        urlHock: "../../hock/activationBill/page.json",
        urlProd: "/route/activationBill/7"
    });

    // 101 查询-出库单号-出库明细
    p[101] = autoPost({
        urlHock: "/hock/warehousingTask/mfunckDoc.json",
        urlProd: "/route/outboundTask/2"
    });
    // 102 出库任务-修改分拣方式
    p[102] = autoPost({
        urlHock: "/hock/warehousingTask/mfunckDoc.json",
        urlProd: "/route/outboundTask/9"
    });
    // 103 查询-储位
    p[103] = autoPost({
        urlHock: "/hock/inputOption/location.json",
        urlProd: "/route/inputOperation/5"
    });
    // 104 查询-入库任务详情
    p[104] = autoPost({
        urlHock: "/hock/warehousingTask/rwmfunckDoc.json",
        urlProd: "/route/outboundTask/1"
    });

    p[0].post(activationBill.option);
</script>